#define _CRT_SECURE_NO_WARNINGS	

int maxDepth(char* s)
{
    char* pcur = s;
    int left = 0;
    int right = 0;
    int max = 0;
    while (*pcur != '\0')
    {
        int gap = left - right;
        if (gap > max)
            max = gap;
        if (*pcur == '(')
            left++;
        if (*pcur == ')')
            right++;
        pcur++;
    }
    return max;
}